package com.gms.action;


import java.util.List;

import com.gms.domain.Product;
import com.gms.service.ProductService;
import com.opensymphony.xwork2.ActionSupport;

public class findProductByProperty extends ActionSupport {
	
	private ProductService productService;
	private String property;
	private List<Product> productList;
	public ProductService getProductService() {
		return productService;
	}
	public void setProductService(ProductService productService) {
		this.productService = productService;
	}
	public String getProperty() {
		return property;
	}
	public void setProperty(String property) {
		this.property = property;
	}
	public List<Product> getProductList() {
		return productList;
	}
	public void setProductList(List<Product> productList) {
		this.productList = productList;
	}
	
	public String findProductByProperty() throws Exception{
		System.out.println("in findProductByProperty method ....");
		property = new String(property.getBytes("iso-8859-1"),"utf-8");
		productList = productService.findAllProductByProperty(property);
		for(Product pro : productList){
			System.out.println(pro.getDescribe());
		}
		return "success";
	}
}
